<template>
  <div class="carousel">
    <h2
      style="
        text-align: center;
        font-size: 32px;
        font-weight: bold;
        color: #333;
        line-height: 1.3;
        padding-bottom: 30px;
      "
    >
      经典案例
    </h2>
    <el-carousel
      arrow="hover"
      :autoplay="false"
      :interval="5000"
      style="width: 1200px; margin: 0 auto;  height: 430px"
    >
      <el-carousel-item v-for="item in 4" :key="item">
        <div class="carousel-item">
          <!-- <img style="width: 100%;height: 100%;" src="@/assets/home/case_back.png" alt="" /> -->
        </div>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
export default {
  name: "Carousel",
  data() {
    return {
    };
  },
  mounted() {
  },
  methods: {
  },
};
</script>

<style scoped lang="scss">
::v-deep .el-carousel {
  background-color: #F3F8FE;
//   cursor: pointer;
  border-radius: 30px;
  .el-carousel__container {
    height: 100% !important;
  }
}
.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  user-select: none;
  margin: 60px 0 0 0;
}
.carousel-item {
    
  background-image: url("@/assets/home/case_back.png");
  width: 100%;
  height: 100%;
  background-size: inherit; /* 图片覆盖整个区域 */
  background-position: center; /* 图片居中显示 */
  background-repeat: no-repeat;// 图片不重复 
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slides {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 100%;
}

.carousel-slide {
  flex: 0 0 100%;
  position: relative;
  height: 100%;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-caption {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  padding: 10px 20px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border-radius: 4px;
}

.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.carousel-button:hover {
  background-color: white;
  transform: translateY(-50%) scale(1.1);
}

.carousel-button.prev {
  left: 20px;
}

.carousel-button.next {
  right: 20px;
}

/* 隐藏原生的按钮焦点样式 */
.carousel-button:focus {
  outline: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .carousel-button {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .carousel-button.prev {
    left: 10px;
  }

  .carousel-button.next {
    right: 10px;
  }

  .carousel-caption {
    padding: 8px 15px;
    font-size: 14px;
  }
}
</style>
